package com.hysf.ioc.pro4_ioc_factorybean;

import com.hysf.ioc.pro4_ioc_factorybean.temp.Apple_D;
import org.springframework.beans.factory.FactoryBean;

public class FruitFactoryBean implements FactoryBean<Fruit> {
	public FruitFactoryBean(){
		System.out.println("FruitFactoryBean constructor");
	}
	
	@Override
	public Fruit getObject() throws Exception {
		return new Apple_D();
	}
	
	@Override
	public Class<?> getObjectType() {
		System.out.println("调用了getObjectType方法");
		return Fruit.class;
	}
}
